package com.qf.day13.map;

import com.qf.day13.mail.MailInfo;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;

/**
 * 使用HashMap代表对象
 *
 */
public class HashMapDemo03 {

    public static void main(String[] args) {

        HashMap<String, Object> mailInfo = new HashMap<>();
        mailInfo.put("sender","Gitee");
        mailInfo.put("title","aaabbb");
        mailInfo.put("sendDate",new Date());
        mailInfo.put("receiver","djl");
        System.out.println(mailInfo);

        HashMap<String, Object> mailInfo1 = new HashMap<>();
        mailInfo1.put("sender","steam");
        mailInfo1.put("title","ccc");
        mailInfo1.put("sendDate",new Date());
        mailInfo1.put("receiver","djl");
        System.out.println(mailInfo);

        ArrayList<HashMap<String, Object>> list = new ArrayList<>();
        list.add(mailInfo);
        list.add(mailInfo1);

        System.out.println(list);

    }

}
